From: Leo Liu Date: Mon, 20 Feb 2012 08:06:52 +0000 (+0800) Subject: Check FROM arg to substring in icomplete-completions X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~324^2~699 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=0f3a131169b580fdb76db463feb6d2f8aa6f845c;p=emacs.git Check FROM arg to substring in icomplete-completions See: http://debbugs.gnu.org/10850 --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5a42ded8933..041b3410a3e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-02-20 Leo Liu + + * icomplete.el (icomplete-completions): Check FROM arg before + passing to substring (Bug#10850). + 2012-02-19 Chong Yidong * comint.el: Require ansi-color. diff --git a/lisp/icomplete.el b/lisp/icomplete.el index 80a0bf1435b..a9719651957 100644 --- a/lisp/icomplete.el +++ b/lisp/icomplete.el @@ -347,7 +347,9 @@ are exhibited within the square braces.)" (setq prospects nil) (while (and comps (not limit)) (setq comp - (if prefix-len (substring (car comps) prefix-len) (car comps)) + (if (and prefix-len (<= prefix-len (length (car comps)))) + (substring (car comps) prefix-len) + (car comps)) comps (cdr comps)) (cond ((string-equal comp "") (setq most-is-exact t)) ((member comp prospects))